package secondkill.config;

import secondkill.pojo.TUser;

public class UserContext {
    //每个线程绑定自己的值
    private static ThreadLocal<TUser> userHolder = new ThreadLocal<TUser>();

    public static void setUser(TUser user){
        userHolder.set(user);
    }
    public static TUser getUser(){
        return userHolder.get();
    }
}
